package com.garen.sys.biz.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.garen.common.MsgBean;
import com.garen.common.PageBean;
import com.garen.sys.biz.IFireMenuBiz;
import com.garen.sys.dao.IFireMenuDao;
import com.garen.sys.entity.FireMenu;


@Service
public class FireMenuBizImpl implements IFireMenuBiz {

	@Autowired
	private IFireMenuDao fireMenuDao;


	@Override
	public 	List<FireMenu> queryMenuByRoleId(Integer roleId) {
		return fireMenuDao.queryMenuByRoleId(roleId);
	}
	
	/*
	*分页查询
	*/
	@Override
	public List<FireMenu> getFireMenuList(PageBean<FireMenu> pb,FireMenu fireMenu){
		return fireMenuDao.getPageList(pb,fireMenu);
	}

	/*
	*分页查询
	*/
	@Override
	public List<FireMenu> getFireMenuList(FireMenu fireMenu){
		return fireMenuDao.getList(fireMenu);
	}

	/*
	*查询个体
	*/
	@Override
	public FireMenu getFireMenu(FireMenu fireMenu){
		return fireMenuDao.get(fireMenu);
	}

	/*
	*保存
	*/
	@Override
	public int saveFireMenu(MsgBean mbean,FireMenu fireMenu){
		int ret = -1;
		if(fireMenu.getMenuId() == null){
			ret = fireMenuDao.add(fireMenu);
		}else{
			ret = fireMenuDao.update(fireMenu);
		}
		return ret;
	}

	/*
	*删除
	*/
	@Override
	public int delFireMenu(MsgBean mbean,FireMenu fireMenu){
		return fireMenuDao.del(fireMenu);
	}

}
